package com.example.leetcode.linkedlist;

import com.example.leetcode.linkedlist.common.LinkedListUtils;
import com.example.leetcode.linkedlist.common.ListNode;

/**
 * Definition for singly-linked list.
 * public class ListNode {
 *     int val;
 *     ListNode next;
 *     ListNode() {}
 *     ListNode(int val) { this.val = val; }
 *     ListNode(int val, ListNode next) { this.val = val; this.next = next; }
 * }
 */
class Solution2 {
    public ListNode addTwoNumbers(ListNode l1, ListNode l2) {
        return LinkedListUtils.addTwoNumbers(l1, l2);
    }
}

public class leetcode2 {
    public static void main(String[] args) {
        Solution2 solution2 = new Solution2();
        int[] nums1 = {2,4,3};
        int[] nums2 = {5,6,4};
        test2(solution2, nums1, nums2);
    }

    private static void test2(Solution2 solution2, int[] nums1, int[] nums2) {
        System.out.println(LinkedListUtils.getLinkedListVals(solution2.addTwoNumbers(LinkedListUtils.generateLinkedListByArray(nums1), LinkedListUtils.generateLinkedListByArray(nums2))));
    }
}
